package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.project.domain.ProjectMicro;
import com.abvnet.project.water.project.service.IProjectMicroService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/project/micro")
public class ApiProjectMicroController extends BaseController {

    @Autowired
    private IProjectMicroService projectMicroService;

    @GetMapping("/get")
    public AjaxResult get(@RequestParam("projectId") Long projectId) {
        return AjaxResult.success(projectMicroService.selectProjectMicroByProjectId(projectId));
    }

    @PostMapping("/edit")
    public AjaxResult editSave(ProjectMicro projectMicro) {
        return toAjax(projectMicroService.updateProjectMicro(projectMicro));
    }
}
